package edu.ustb.struts2.action;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.convention.annotation.Results;

@ParentPackage(value="system")
@Action(value="LoginAction")
@Namespace("/")
@Results({
	@Result(name="success",type="dispatcher",location="main.jsp"),
	@Result(name="fail",type="dispatcher",location="login.jsp")
})
public class LoginAction extends BaseAction {

	/**
	 * 
	 */
	private static final long serialVersionUID = -5267244434891284947L;
	
	
	public String login() {
		String userName = request.getParameter("userName");
		String password = request.getParameter("password");
		if (userName.equals("lijia") || password.equals("123456")) {
			return "success";
		} else {
			return "fail";
		}
	}

	
}
